<template>
  <div class="staffs">
      <Nav :navtitle="titles"></Nav>
      <div class="back">
          <div class="content" v-for="(item,index) in data" :key="index">
                <div class="one">
                    <span class="one-span">联系方式</span>
                    <span class="phone">{{item.mainContactsPhone}}</span>
                </div>
                <div class="one">
                    <span>员工</span>
                    <span class="phone two" style="margin-left:0.5rem;">{{item.mainContacts}}</span>
                </div>
                <div class="one">
                    <span>所属门店</span>
                    <span class="phone  three" style="margin-left:0.2rem">全部门店</span>
                </div>
           </div>
      </div>
  </div>
</template>

<script>
import Nav from '../../components/Navbar'
import BScroll from 'better-scroll'
export default {
     components:{
       Nav
   },
  data(){
      return{
        titles:'员工详情',
        data:''
      }
  },
  methods:{
      getListOfShopByGroupId(){
           let groupId=this.$store.state.userInfo.groupId
            let headers;
                    if (this.$store.state.token) {
                        headers = {
                        token: this.$store.state.token,
                        userId: this.$store.state.userInfo.id
                        };
                    } else {
                        headers = {};
                    }
            this.$http.post('https://web-gateway.newbeescm.com/b2b-app-web/getListOfShopByGroupId?groupId='+groupId,{},{headers})
            .then(res=>{
                console.log(res)
                this.data=res.data.result.items
                console.log(this.data)
            })
            .catch(err=>{
                console.log(err)
            })
      },
  },
   mounted(){
      let staffs = document.querySelector('.staffs')
      let scroll =  new BScroll(staffs)
    },
  created(){
      this.getListOfShopByGroupId()
  }
}

</script>
<style scoped lang="scss">
.title{
    position:fixed;
    top:0;
    left:0;
    z-index:99;
}
.content{
    width:100%;
    background:#fff;
    position: absolute;
    top:0.43rem;
    left:0;
   .one{
        width:100%;
        height:0.4rem;
        border-bottom:0.01rem #f1f2f6 solid;
        display:flex;
        align-items:center;
        box-sizing:border-box;
        padding-left:0.1rem;
        font-size:0.15rem;
      .phone{
        //   display: flex;
        //   flex:1;
          margin-left:0.2rem;
          color:#737373;
      }
   }
}
</style>